-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix underflow in fee estimation in the presence of withdrawal and max amount #2086
Fix underflow in fee estimation in the presence of withdrawal and max amount #2086
Conversation
, expectField (#estimatedMax . #getQuantity) (.<= oneAda) | ||
] | ||
|
||
it "TRANS_ESTIMATE_03b - we see result when we can't cover fee (with withdrawal)" $ \ctx -> do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it "TRANS_ESTIMATE_03b - we see result when we can't cover fee (with withdrawal)" $ \ctx -> do | |
it "TRANS_ESTIMATE_03b - we see result when we can't cover fee \ | |
\(with withdrawal)" $ \ctx -> do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm from black-box functional perspective.
I have tested on MC4 with self
and mnemonic sentence
withdrawal on a wallet with rewards and fee amt is OK. The same fee amt is then applied when sending tx.
…of withdrawal This currently fails, 'as expected', next commit will fix the issue.
…flow in fee calculation.
…es beyond a certain amount. This should _not_ be the case, but the contrary would be disastrous for the user. I was getting a little paranoid about this recently, so I think having the wallet crash loudly in such case is a good and sane idea.
10ab550
to
f0e7ae2
Compare
bors r+ |
Build succeeded |
Issue Number
#2062
Overview
10ab550 out of paranoia, add an invariant to make transactions never leave fees beyond a certain amount.
3d4469c pass down withdrawal value to 'handleCannotCoverFee' to prevent underflow in fee calculation.
f6e74dc add extra scenario covering fee estimation edge-case in the presence of withdrawal
TODO: I'd like to add one property or scenario to exercise the invariant and shows that it operates as expected.
Comments